Public Class frmRECHARGE

    Private Sub txtCardNumber_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtCardNumber.KeyDown
        If e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Tab Then
            Dim dt As DataTable
            Dim arName As New ArrayList
            arName.Add("@SERIAL")
            Dim arVal As New ArrayList
            arVal.Add(txtCardNumber.Text)
            dt = BLL.ObjectGetBy("VOUCHER_CHECKSERIAL", arName, arVal)

            If dt.Rows.Count > 0 Then
                Dim type As Integer
                type = dt.Rows(0).Item("TYPE")
                If type <> 2 Then
                    SystemFunction.ShowMessageForm("CAN'T CHARGE TO GIFT CARD!", "")
                Else
                    txtRemainAmount.Text = dt.Rows(0).Item("REMAIN")
                    txtUsedAmount.Text = dt.Rows(0).Item("USED")
                    ckPrepaidCard.Checked = True
                End If
            Else
                txtRemainAmount.Text = 0
                txtUsedAmount.Text = 0
            End If
        End If
    End Sub

    Private Sub frmRECHARGE_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Try
            GC.Collect()
            Me.Dispose()
        Catch ex As Exception

        End Try
    End Sub
End Class